package com.livew.framework.base.service;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.livew.framework.base.model.FileEO;
import com.livew.framework.exception.XTBusinessException;

public interface FileService extends BaseService<FileEO> {

	void saveFiles(List<FileEO> files) throws XTBusinessException;

	void updateBySrcName(FileEO FileEO) throws XTBusinessException;

	void delBySrcName(FileEO FileEO) throws XTBusinessException;

	Map<Long, List<FileEO>> getListToMap(List<Long> caseIds, String caseClazz, String type);

	List<FileEO> getList(List<Long> caseIds, String caseClazz, String type);

	
	/**
	 * 根据主键批量更新
	 * @param ids
	 * @param caseId
	 * @param caseClazz
	 * @throws XTBusinessException
	 */
	void updateList(List<Long> ids,Long caseId,String caseClazz)throws XTBusinessException;
	
	/**
	 * 取caseId中的第一条
	 * 
	 * @param caseIds
	 * @param caseClazz
	 * @param type
	 * @return
	 */
	Map<Long, FileEO> getMapTopOne(List<Long> caseIds, String caseClazz, String type);

	/**
	 * 文件上传 dfs
	 * 
	 * @param FileEO
	 * @return
	 * @throws Exception
	 */
	FileEO insertDfs(MultipartFile FileEO) throws Exception;

	/**
	 * 文件上传 dfs
	 * 
	 * @param FileEO
	 * @return
	 * @throws Exception
	 */
	void insertDfs(FileEO FileEO, byte[] byteArray) throws Exception;

	
	List<FileEO> getFileByIds(List<Long> caseIds,String caseClazz,String type);
	
	List<FileEO> getFileById(Long caseId,String caseClazz,String type);
	
	/**
	 * 根据业务类型主键，业务类型查找图片主键
	 * @Description:
	 * @param caseId
	 * @param caseClazz
	 * @param type
	 * @return 
	 * @author wt1293
	 * @date 2018年8月9日下午8:31:46
	 *
	 */
	List<Long> getFileByCaseId(Long caseId,String caseClazz,String type);

}
